﻿using System;
using System.Windows.Forms;

namespace Gencode.Common.Errorhandling
{
	class MessageBox// : System.Windows.Forms.MessageBox
	{
		public enum Buttons { OKCancle, OK, YesNo, YesNoCancle };

		//public MessageBox():base(){
		//}
		
		/// <summary>
		/// Same as System.Windows.Forms.MessageBox(string message, string caption, MessageBoxButtons buttons)
		/// </summary>
		/// <param name="message">Message</param>
		/// <param name="caption">Caption</param>
		/// <param name="buttons">Buttontypes</param>
		public static void Show(string message, string caption, MessageBoxButtons buttons)
		{
			System.Windows.Forms.MessageBox.Show(message, caption, buttons);
		}

		/// <summary>
		/// Default MessageBox with OKCancel buttons
		/// </summary>
		/// <param name="message">Message to be displayed</param>
		/// <param name="caption">Caption for messagebox</param>
		public static void Show(string message, string caption)
		{
			Show(message, caption, MessageBoxButtons.OKCancel);
		}

		public static void Show(string message, string caption, Buttons button)
		{
			MessageBoxButtons btn = MessageBoxButtons.OK;
			switch (button)
			{
				case Buttons.OK:
					btn = MessageBoxButtons.OK;
					break;

				case Buttons.OKCancle:
					btn = MessageBoxButtons.OKCancel;
					break;
				case Buttons.YesNo:
					btn = MessageBoxButtons.YesNo;
					break;
				case Buttons.YesNoCancle:
					btn = MessageBoxButtons.YesNoCancel;
					break;
			}

			Show(message, caption, btn);
		}
	}
}
